package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家", model = "商家")
@Entity
@Table(name = "bs_merchant")
@Comment("商家表")
public class Merchant extends AbstractEntity {

    @Comment("商家名称")
    @SearchItem(name = "name", key = "name", label = "商家名称")
    @FormField(title = "商家名称", sortNum = "1", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String name;

    @Comment("商家编码")
    @SearchItem(name = "code", key = "code", label = "商家编码")
    @FormField(title = "商家编码", sortNum = "2", grid = true)
    @Column(length = 50, unique = true)
    private String code;

    @Comment("商家Logo")
    @FormField(title = "商家Logo", sortNum = "3", type = InputType.image)
    @Column(length = 500)
    private String logo;

    @Comment("商家横幅")
    @FormField(title = "商家横幅", sortNum = "4", type = InputType.image)
    @Column(length = 500)
    private String banner;

    @Comment("商家描述")
    @FormField(title = "商家描述", sortNum = "5", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String description;

    @Comment("联系人")
    @SearchItem(name = "contactPerson", key = "contactPerson", label = "联系人")
    @FormField(title = "联系人", sortNum = "6", grid = true)
    @Column(length = 100)
    private String contactPerson;

    @Comment("联系电话")
    @SearchItem(name = "contactPhone", key = "contactPhone", label = "联系电话")
    @FormField(title = "联系电话", sortNum = "7", grid = true)
    @Column(length = 20)
    private String contactPhone;

    @Comment("联系邮箱")
    @FormField(title = "联系邮箱", sortNum = "8", type = InputType.email)
    @Column(length = 100)
    private String contactEmail;

    @Comment("营业执照")
    @FormField(title = "营业执照", sortNum = "9", type = InputType.image)
    @Column(length = 500)
    private String businessLicense;

    @Comment("身份证正面")
    @FormField(title = "身份证正面", sortNum = "10", type = InputType.image)
    @Column(length = 500)
    private String idCardFront;

    @Comment("身份证背面")
    @FormField(title = "身份证背面", sortNum = "11", type = InputType.image)
    @Column(length = 500)
    private String idCardBack;

    @Comment("省份")
    @SearchItem(name = "province", key = "province", label = "省份")
    @FormField(title = "省份", sortNum = "12", grid = true)
    @Column(length = 50)
    private String province;

    @Comment("城市")
    @SearchItem(name = "city", key = "city", label = "城市")
    @FormField(title = "城市", sortNum = "13", grid = true)
    @Column(length = 50)
    private String city;

    @Comment("区县")
    @SearchItem(name = "district", key = "district", label = "区县")
    @FormField(title = "区县", sortNum = "14", grid = true)
    @Column(length = 50)
    private String district;

    @Comment("详细地址")
    @SearchItem(name = "address", key = "address", label = "详细地址")
    @FormField(title = "详细地址", sortNum = "15", grid = true)
    @Column(length = 500)
    private String address;

    @Comment("经度")
    @FormField(title = "经度", sortNum = "16", type = InputType.el_input_number)
    @Column(precision = 10, scale = 7)
    private BigDecimal longitude;

    @Comment("纬度")
    @FormField(title = "纬度", sortNum = "17", type = InputType.el_input_number)
    @Column(precision = 10, scale = 7)
    private BigDecimal latitude;

    @Comment("营业时间")
    @FormField(title = "营业时间", sortNum = "18", grid = true)
    @Column(length = 200)
    private String businessHours;

    @Comment("经营范围")
    @FormField(title = "经营范围", sortNum = "19", type = InputType.textarea)
    @Column(length = 1000)
    private String businessScope;

    @Comment("商家类型")
    @SearchItem(name = "merchantType", key = "merchantType", label = "商家类型")
    @FormField(title = "商家类型", sortNum = "20", grid = true, type = InputType.select)
    @Column(length = 20)
    private String merchantType;

    @Comment("商家等级")
    @SearchItem(name = "merchantLevel", key = "merchantLevel", label = "商家等级")
    @FormField(title = "商家等级", sortNum = "21", grid = true, type = InputType.select)
    @Column(length = 20)
    private String merchantLevel;

    @Comment("商家状态")
    @SearchItem(name = "status", key = "status", label = "商家状态")
    @FormField(title = "商家状态", sortNum = "22", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("审核状态")
    @SearchItem(name = "auditStatus", key = "auditStatus", label = "审核状态")
    @FormField(title = "审核状态", sortNum = "23", grid = true, type = InputType.select)
    @Column(length = 20)
    private String auditStatus;

    @Comment("审核时间")
    @FormField(title = "审核时间", sortNum = "24")
    private Date auditTime;

    @Comment("审核人ID")
    @FormField(title = "审核人", sortNum = "25", type = InputType.select)
    private Long auditUser;

    @Comment("审核备注")
    @FormField(title = "审核备注", sortNum = "26", type = InputType.textarea)
    @Column(length = 1000)
    private String auditRemark;

    @Comment("保证金金额")
    @FormField(title = "保证金金额", sortNum = "27", type = InputType.el_input_number)
    @Column(precision = 10, scale = 2)
    private BigDecimal depositAmount;

    @Comment("保证金是否已缴纳")
    @FormField(title = "保证金是否已缴纳", sortNum = "28")
    private Boolean depositPaid;

    @Comment("佣金比例")
    @FormField(title = "佣金比例", sortNum = "29", type = InputType.el_input_number)
    @Column(precision = 5, scale = 2)
    private BigDecimal commissionRate;

    @Comment("结算周期")
    @FormField(title = "结算周期", sortNum = "30", type = InputType.select)
    @Column(length = 20)
    private String settlementCycle;

    @Comment("开户银行")
    @FormField(title = "开户银行", sortNum = "31")
    @Column(length = 100)
    private String bankName;

    @Comment("银行账号")
    @FormField(title = "银行账号", sortNum = "32")
    @Column(length = 50)
    private String bankAccount;

    @Comment("开户名")
    @FormField(title = "开户名", sortNum = "33")
    @Column(length = 100)
    private String bankAccountName;
} 